import request from '@/utils/request'
// 获取所有用户
export function getUsers() {
  return request({
    url: 'getUsers/',
    method: 'get'
  })
}
// 条件获取多个用户
export function getUsersByUsername(username) {
  return request({
    url: `getUsersByUsername/${username}`,
    method: 'get'
  })
}
// 条件获取一个用户
export function getUserByUsername(username) {
  return request({
    url: `getUserByUsername/${username}`,
    method: 'get'
  })
}
// 删除用户
export function deleteUser(username) {
  return request({
    url: `deleteUser/${username}`,
    method: 'delete'
  })
}

// 修改用户
export function updateUser(username, data) {
  return request({
    url: `updateUser/${username}/`,
    method: 'put',
    data
  })
}
